<?php
use yii\helpers\Html;
use yii\web\View;
use backend\models\activeRecords\Guild;
use kartik\widgets\ActiveForm;
use yii\helpers\Url;
use kartik\builder\FormGrid;
use kartik\builder\Form;
use common\libs\Constants;

/* @var $this View */
/* @var $model Guild */
/* @var $form ActiveForm */
?>
<?php $form = ActiveForm::begin([
    'id' => 'guild-form',
    'type' => ActiveForm::TYPE_VERTICAL,
    'options' => [
        'enctype' => 'multipart/form-data'
    ],
    'enableAjaxValidation' => true,
    'validationUrl' => Url::toRoute(['validate-form'])
]);
echo FormGrid::widget([
    'model' => $model,
    'form' => $form,
    'autoGenerateColumns' => true,
    'rows' => [
        [
            'attributes' => [
                'guild_name' => [
                    'type' => Form::INPUT_TEXT,
                ],
                'guild_sign' => [
                    'type' => Form::INPUT_TEXT,
                ],
            ]
        ],
        [
            'attributes' => [
                'guild_contact' => [
                    'type' => Form::INPUT_TEXT,
                ],
                'guild_phone' => [
                    'type' => Form::INPUT_TEXT,
                ],
            ]
        ],
        [
            'attributes' => [
                'guild_qq' => [
                    'type' => Form::INPUT_TEXT,
                ],
                'guild_status' => [
                    'type' => Form::INPUT_DROPDOWN_LIST,
                    'items'=>Constants::getStatusItems()
                ],
            ]
        ],
        [
            'attributes' => [
                'guild_divide' => [
                    'type' => Form::INPUT_TEXT,
                ],
                'guild_deducted' => [
                    'type' => Form::INPUT_TEXT,
                ],
            ]
        ],
        [
            'attributes' => [
                'actions' => [    // embed raw HTML content
                    'type' => Form::INPUT_RAW,
                    'value' => '<div style="text-align: center;">' .
                        Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) .
                        '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' .
                        Html::submitButton(Yii::t('app', 'Save'), ['class' => 'btn btn-primary']) .
                        '</div>'
                ],
            ]
        ]
    ]
]);
ActiveForm::end();